<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js对象</title>
		<script>
			var person={name:"lily",age:18,
			tostring:function(){//写了个方法,静态方法，在声明对象时构造
				return this.name+this.age;
			}
			};
			
			person.toUpperCase=function(){//动态扩充的方法
				return this.name.toUpperCase();
			}
			person.school="中国人民大学";//动态扩充字段
			alert(person);
			alert(person.name);

			console.log(person);
			console.log(person.tostring());
			console.log(person.toUpperCase());
		</script>
	</head>
	<body>
	</body>
</html>
